package com.dk.demo.core.service.strategy.impl;

import com.dk.demo.common.model.strategy.StrategyType;
import com.dk.demo.common.model.strategy.impl.AInputDTO;
import com.dk.demo.common.model.strategy.impl.AOutputDTO;
import com.dk.demo.core.service.strategy.AbstractStrategy;
import org.springframework.stereotype.Component;

@Component
public class AStrategy extends AbstractStrategy<AInputDTO,AOutputDTO> {


    @Override
    public StrategyType type() {
        return StrategyType.MERGE;
    }

    @Override
    public AOutputDTO exec(AInputDTO inputDTO) {
        AOutputDTO outputDTO = new AOutputDTO().setMerge(inputDTO.getA() + inputDTO.getB());
        outputDTO.setResult(type().getDescription());
        return outputDTO;
    }
}
